package com.coderman.domainservice.member.app.executor;

import com.coderman.domainservice.blogtopic.app.command.PublishBlogCmd;
import com.coderman.domainservice.blogtopic.domain.convertor.BlogConvertor;
import com.coderman.domainservice.member.app.command.MakeFansCommand;
import com.coderman.domainservice.member.domain.gataway.UserService;
import com.coderman.domainservice.member.domain.model.user.entity.FriendBO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * Description:
 * date: 2021/4/12
 *
 * @author shenshuai
 * @version 1.0.0
 * @since JDK 1.8
 */
@Service
public class MakeFansExe {

    @Autowired
    private UserService userService;
    public String execute(MakeFansCommand cmd) {
        FriendBO friendBO = new FriendBO();
        friendBO.setCreateTime(new Date());
        friendBO.setFriendAccountId(cmd.getMakeFansVO().getFriendAccountId());
        friendBO.setMyAccountId(cmd.getMakeFansVO().getMyAccountId());
        userService.newFriends(friendBO);
        return "";
    }
}
